package com.sam.demo.spring;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import com.sam.demo.spring.service.UserService;

@SpringBootApplication
public class AppStart {

	public static void main(String[] args) {
		ApplicationContext beanFactory = SpringApplication.run(AppStart.class, args);
		UserService userService = beanFactory.getBean(UserService.class);
		String name = userService.getUserName();
		System.out.println(name);
	}
}
